/*
 * @Description:
 * @Version: 2.0
 * @Autor: wsh
 * @Date: 2023-06-20 18:06:15
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2023-10-11 17:11:29
 */
// 列表
const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '养老机构', prop: 'organizationName' },
		{ label: '房间号', prop: 'roomCode' },
		{ label: '床位数（普通型）', prop: 'bedNormalNum' },
		{ label: '床位数（护理型）', prop: 'bedNursingNum' },
		{ label: '房间面积', prop: 'roomArea' },
		{ label: '备注', prop: 'roomNote' },
		{
			label: '操作',
			prop: 'menu',
			width: 300,
			fixed: 'right',
		},
	],
}

export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'top',
	column: [
		{ label: '养老机构名称', prop: 'organizationName', span: 12 },
		{ label: '统一信用代码', prop: 'creditCode', span: 12 },
		{ label: '楼栋名称', prop: 'buildingName', span: 12 },
		{ label: '楼栋总层数', prop: 'buildingFloors', span: 12 },
		{ label: '楼栋地址', prop: 'buildingAddress', span: 12 },
		{
			label: '是否有电梯',
			prop: 'elevator',
			propName: 'elevatorLabel',
			changeField: true,
			code: 'COMMON_FLAG',
			type: 'remoteSelect',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 12,
		},
	],
}

export const baseConfig = {
	pageName: '机构房间管理',
	// 数据字典
	dictcodes: ['COMMON_FLAG'],
	addLabel: '新增楼栋',
	rowKey: 'id',
	tipLabel: 'buildingName',
	api: {
		index: 'view_dpOrgBulidingInfo_page',
		add: 'view_dpOrgBulidingInfo_add',
		edit: 'view_dpOrgBulidingInfo_edit',
		delete: 'view_dpOrgBulidingInfo_del',
	},
	auth: {
		index: 'view_dpOrgBulidingInfo_page',
		add: 'view_dpOrgBulidingInfo_add',
		edit: 'view_dpOrgBulidingInfo_edit',
		delete: 'view_dpOrgBulidingInfo_del',
		mulitSet: 'mulitSet',
	},
	// 当前行操作按钮
	menuBtn: [
		{
			icon: 'detail',
			label: '查看',
			operate: 'detail',
			auth: 'view_dpOrgBulidingInfo_page',
			text: true,
			show: true,
		},
		{
			icon: 'editor',
			label: '编辑',
			operate: 'edit',
			auth: 'view_dpOrgBulidingInfo_edit',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			operate: 'delete',
			auth: 'view_dpOrgBulidingInfo_del',
			text: true,
			show: true,
		},
	],
	dialogConfig: {
		width: '80%',
	},
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{ label: '房间号', prop: 'roomCode', span: 8 },
			{ label: '养老机构', prop: 'organizationName', span: 8 },
			{ label: '房间面积', prop: 'roomAreaBetween', span: 12, type: 'RangeValue' },
		],
	},
	// 列表
	tableConfig,
	// 详情
	detailConfig: formConfig,
	formConfig,
	beforeOnLoadFormate: (query) => {
		console.log(query, 'beforeOnLoadFormate')
		return new Promise((resolve, reject) => {
			console.log(query, 'Promise')
			resolve({
				...query,
			})
		})
	},
}
